home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / D-G / FORTRAN Goodies / PcallsF / FortSubs.f next >
Encoding:
Text File  |  1990-12-03  |  1.1 KB  |  48 lines  |  [TEXT/MPS ]

  1. c    This collection of subroutines is called by the Pascal
  2. c    program PcallsF.
  3. c
  4. c    Example provided for owners of Language Systems FORTRAN
  5. c    © 1990 Language Systems Corp.
  6. c
  7.  
  8.     SUBROUTINE Charfill (cc)    !Expect arguments by descriptor
  9.     
  10.     CHARACTER*20 cc                !Define the argument
  11.     
  12.     cc = 'Hello World!'
  13.     
  14.     END
  15.     
  16.     SUBROUTINE Charfill2(cc)    !Expects argument by reference
  17.     
  18.     STRUCTURE /C/
  19.         CHARACTER*20 ch            !Define the argument
  20.     END STRUCTURE
  21.     
  22.     RECORD /C/ cc
  23.     cc.ch = 'This is a switch!'
  24.     
  25.     END
  26.     
  27.     SUBROUTINE SumArray(iary,%val(n),total)
  28. !    Expects first argument by reference, second by value
  29.     integer*2 iary(100),total,index, n    !Define the arguments and work counter
  30.     
  31.     total = 0                    !Clear the total
  32.     
  33.     do index = 1,n                !Step through the array
  34.     total = total + iary(index)    !Add them up
  35.     end do
  36.     
  37.     end                            !And exit
  38.     
  39.     SUBROUTINE SumArray2
  40.     integer*2 iary2(100),total2,index,n2    !Define arguments and work counter
  41.     COMMON /TEST/ iary2,total2,n2
  42.     total2 = 0                    !Clear the total
  43.     
  44.     do index = 1,n2                !Step through the array
  45.     total2 = total2+iary2(index)    !Add them up
  46.     enddo
  47.     
  48.     end                            !And exit